package com.example.springbootprodb.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 路老师
 * @date 2025/4/9
 * 无精神，不编程！无乐趣，不编程！
 * “调试：与bug共舞的艺术。”
 * 返回给前端的数据接口提示信息对象
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private Integer code;//0  失败 1 成功
    private String msg;//结果描述
    private Object data;//返回数据
    //增删改
    public static Result success()
    {
        return new Result(1,"success",null);
    }
     //查询
     public static Result success(Object data)
     {
         return new Result(1,"success",data);
     }

    //响应失败
    public static Result success(String msg)
    {
        return new Result(0,msg,null);
    }

}
